<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 加载部部样式及META信息 -->
    <title>修改</title>
    <div th:replace="common/meta"></div>
    <script>
        require.config.jsname = "backend/role/group";
        require.config.modulename = "admin"
        require.config.controllername = "auth.admin"
        require.config.actionname = "edit"
        require.config.moduleurl = "/admin/add"
    </script>
</head>


<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <section class="content-header hide">
                        <h1>
                            控制台 <small>Control panel</small>
                        </h1>
                    </section>
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" method="POST" data-before-submit="refreshrules" action="/sys/role/save">
                            <input type="hidden" name="id" th:value="${role.id}"/>
                            <input type="hidden" name="resources" th:value="${resourceIds}" />
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">键:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="name" name="role_key" th:value="${role.role_key}" data-rule="required"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">描述:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" name="role_desc" th:value="${role.role_desc}" data-rule="required"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">权限:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <span class="text-muted"><input type="checkbox" name="" id="checkall"/> <label for="checkall"><small>选中全部</small></label></span>
                                    <span class="text-muted"><input type="checkbox" name="" id="expandall"/> <label for="expandall"><small>展开全部</small></label></span>
                                    <div id="treeview"></div>
                                </div>
                            </div>
                            <div class="form-group hidden layer-footer">
                                <label class="control-label col-xs-12 col-sm-2 col-xs-2"></label>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<div th:replace="common/script"></div>
</body>
<script th:inline="javascript">
    var resourceIds = [[${resourceIds}]];
    var role = [[${role}]];
</script>
</html>